<template>
    <div>
        <a-form
            ref="save_form"
            :model="saveFormData"
            :label-col="{ span: 2 }"
            :wrapper-col="{ span: 10 }"
        >
            <a-form-item label="系统名称" name="name" :rules="[{ required: true, message: '' }]">
                <a-input v-model:value="saveFormData.name"/>
            </a-form-item>
            <a-form-item label="客服电话" name="tel" :rules="[{ required: true, message: '' }]">
                <a-input v-model:value="saveFormData.tel"/>
            </a-form-item>
            <a-form-item label="LOGO" name="logo_img" :rules="[{ required: true, message: '' }]">
                <Upload :maxCount="1" v-model:value="saveFormData.logo_img"/>
            </a-form-item>
            <a-form-item label="审核" name="is_review" :rules="[{ required: true, message: '' }]">
              <YesOrNo v-model:value="saveFormData.is_review"/>
            </a-form-item>

            <a-form-item>
                <div class="justify-center">
                    <a-button type="primary" html-type="submit" @click="submit">提交</a-button>
                </div>
            </a-form-item>

        </a-form>
    </div>

</template>

<script>
export default {
    name: "config",
    data() {
        return {
            saveFormData: {}
        }
    },
    props: {
        prop1: {type: Object, default: null, required: false}
    },
    computed: {
        computed1() {
        }
    },
    created() {
        this.getConfigs()
    },
    methods: {
        getConfigs() {
            this.get('/index/index/configs').then(({code, configs}) => {
                if (code === 1) {
                    this.saveFormData = configs
                }
            })
        },
        submit() {
            console.log(1111, this.saveFormData)
            this.post('/admin/config/save', this.saveFormData).then(({code}) => {
                if (code === 1) {
                    this.success('保存成功！');
                }
            })
        },
    },
    watch: {
        watched1(value) {
        }
    },
    components: {}
}
</script>

<style scoped>

</style>